package com.ruoyi.project.zerocarbon.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.zerocarbon.mapper.DeclareImplementationPlanMapper;
import com.ruoyi.project.zerocarbon.domain.DeclareImplementationPlan;
import com.ruoyi.project.zerocarbon.service.IDeclareImplementationPlanService;

/**
 * 项目实施情况及计划Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-13
 */
@Service
public class DeclareImplementationPlanServiceImpl implements IDeclareImplementationPlanService 
{
    @Autowired
    private DeclareImplementationPlanMapper declareImplementationPlanMapper;

    /**
     * 查询项目实施情况及计划
     * 
     * @param id 项目实施情况及计划ID
     * @return 项目实施情况及计划
     */
    @Override
    public DeclareImplementationPlan selectDeclareImplementationPlanById(Long id)
    {
        return declareImplementationPlanMapper.selectDeclareImplementationPlanById(id);
    }

    /**
     * 查询项目实施情况及计划列表
     * 
     * @param declareImplementationPlan 项目实施情况及计划
     * @return 项目实施情况及计划
     */
    @Override
    public List<DeclareImplementationPlan> selectDeclareImplementationPlanList(DeclareImplementationPlan declareImplementationPlan)
    {
        return declareImplementationPlanMapper.selectDeclareImplementationPlanList(declareImplementationPlan);
    }

    /**
     * 新增项目实施情况及计划
     * 
     * @param declareImplementationPlan 项目实施情况及计划
     * @return 结果
     */
    @Override
    public int insertDeclareImplementationPlan(DeclareImplementationPlan declareImplementationPlan)
    {
        declareImplementationPlan.setCreateTime(DateUtils.getNowDate());
        return declareImplementationPlanMapper.insertDeclareImplementationPlan(declareImplementationPlan);
    }

    /**
     * 修改项目实施情况及计划
     * 
     * @param declareImplementationPlan 项目实施情况及计划
     * @return 结果
     */
    @Override
    public int updateDeclareImplementationPlan(DeclareImplementationPlan declareImplementationPlan)
    {
        declareImplementationPlan.setUpdateTime(DateUtils.getNowDate());
        return declareImplementationPlanMapper.updateDeclareImplementationPlan(declareImplementationPlan);
    }

    /**
     * 批量删除项目实施情况及计划
     * 
     * @param ids 需要删除的项目实施情况及计划ID
     * @return 结果
     */
    @Override
    public int deleteDeclareImplementationPlanByIds(Long[] ids)
    {
        return declareImplementationPlanMapper.deleteDeclareImplementationPlanByIds(ids);
    }

    /**
     * 删除项目实施情况及计划信息
     * 
     * @param id 项目实施情况及计划ID
     * @return 结果
     */
    @Override
    public int deleteDeclareImplementationPlanById(Long id)
    {
        return declareImplementationPlanMapper.deleteDeclareImplementationPlanById(id);
    }
}
